<tagLib name="html" />
<div id="main-content">
    <div id="main" class="main">
        <!-- 修改密码 start -->
        <div class="spin-cont">
            <div class="user-hd">
                <h2>财务管理>>{$page_title}</h2>
            </div>
            <div class="user_zl">
                <form name="data_form" id="data_form" method="POST">
                <dl class="clearfix">
                    <dt>充值方式：</dt>
                    <dd>
                        <html:select options="recharge_type_options" name="recharge_from" id="recharge_from" change="changeRechargeFrom()" />
                    </dd>
                </dl>
                <dl class="clearfix">
                    <dt>充值主机：</dt>
                    <dd>{$cinema_host.host_name}</dd>
                </dl>
                <dl class="clearfix">
                    <dt>影院名称：</dt>
                    <dd>{$cinema_host.cinema_name}</dd>
                </dl>
                <dl class="clearfix">
                    <dt>充值申请人：</dt>
                    <dd>{$user_info.user_name}</dd>
                </dl>
                <dl class="clearfix">
                    <dt>充值金额：</dt>
                    <dd><input type="text" id="money" name="money" maxlength="8" class="bg-input w229"/> 元</dd>
                    <dd class="error_message" id="message_money"></dd>
                </dl>
                <dl class="clearfix not_cash_field">
                    <dt>充值凭证号：</dt>
                    <dd><textarea id="description" name="description" class="bg-textarea w229"></textarea></dd>
                    <dd class="error_message" id="message_description"></dd>
                </dl>
                <dl class="clearfix">
                    <dt>凭证上传：</dt>
                    <dd style="width:239px;">
                        <link rel="stylesheet" href="__PUBLIC__/admin/css/upload.css">
                        <div class="speechbox_add">
                            <div class="uploadBox">
                                <input type="hidden" name="img_url" id="u0_input" value="" class="bg-input w229"/>
                                <div class="upload_area">
                                    <div class="uImg uImg1" id="u0_divhide"  style="display: block;">
                                        <span class="op"><input type="file" class="inputFile" id="u0_placeholder_0" /></span>
                                    </div>
                                    <div class="uImg uImg1" id="u0_divshow" style="display: none;">
                                        <img src="" />
                                    <span class="op_2">
                                        <input type="file" class="inputFile" id="u0_placeholder_1" /> | <a href="javascript:void(0)" onclick="deleteUpload('u0')">删除照片</a>
                                    </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </dd>
                    <dd class="error_message" id="message_img_url"></dd>
                </dl>
                <dl class="clearfix not_cash_field">
                    <dt>到款银行：</dt>
                    <dd><html:select options="bank_account_options" name="account_name" id="account_name" change="changeAccountNumber()" /></dd>
                    <dd class="error_message" id="message_account_name"></dd>
                </dl>
                <dl class="clearfix not_cash_field">
                    <dt>账户号码：</dt>
                    <dd>
                        <span id="account_number_show">{$bank_account_map_options[1]}</span>
                        <div class="hidden">
                        <html:select options="bank_account_map_options" name="account_number" id="account_number" />
                        </div>
                    </dd>
                    <dd class="error_message" id="message_account_number"></dd>
                </dl>
                <dl class="clearfix">
                    <dt></dt>
                    <dd>
                        <a href="javascript:;" class="gray-btn" onclick="recharge()">确认充值</a>
						<a href="javascript:;" class="gray-btn" onclick="reset('data_form')">取消</a>
                        <input type="hidden" name="id" value="{$id}" />
                        <input type="hidden" name="referer" value="{$Think.config.REFERER}" />
                    </dd>
                </dl>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="/Public/static/uploadify/jquery.uploadify.min.js"></script>
<style>
    .speechbox_add .upload_area .uImg1 .op{width: 200px;height: 200px}
    .speechbox_add .upload_area .uImg1 {width: 200px;height: 200px}
    .speechbox_add .upload_area .uImg1 img {width: 200px;height: 200px; display: block;}
    .speechbox_add .upload_area {width: 200px; height: 200px;}
</style>
<script>
    var buttonsize_b = {"width":200,"height":200};
    var buttonsize_s = {"width":55,"height":19};
    //初始化
    specialUpload('u0_placeholder_0',buttonsize_b,'u0',false);
    specialUpload('u0_placeholder_1',buttonsize_s,'u0',true);

    function specialUpload(id,buttonsize,keyname,showtext){
        var textValue = (showtext) ? '重新上传' : '';
        var  swfu = new SWFUpload({
            upload_url:"{:U('/Admin/Common/upload',array('type'=>'recharge'))}",
            file_types : "*.png;*.jpg;*.jpeg;*.bmp;*.gif",
            file_dialog_complete_handler : function(numFilesSelected, numFilesQueued) {
                try {
                    if (numFilesQueued > 0) {
                        this.startUpload();
                    }
                } catch (ex) {
                    ui.error(ex)
                }
            },
            upload_progress_handler : function(file, bytesLoaded) {
                var percent = Math.ceil((bytesLoaded / file.size) * 100);
                //ui.error(percent);
            },
            upload_error_handler : function(file, errorCode, message) {
                ui.error(message);
            },
            upload_success_handler : function(file, serverData) {
                var data = jQuery.parseJSON(serverData);
                $("#"+keyname + '_input').val(data.url);
                $("#"+keyname+'_divhide').hide();
                $("#"+keyname+'_divshow').show();
                $("#"+keyname+'_divshow').find('img').attr("src",data.url);
            },
            upload_complete_handler : function(file){},
            button_placeholder_id : id,
            button_text:textValue,
            //button_text_style:'color: #000000; font-size: 16pt;',
            button_width: buttonsize.width,
            button_height: buttonsize.height,
            button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
            button_cursor: SWFUpload.CURSOR.HAND,
            flash_url : "/Public/static/uploadify/uploadify.swf",
            debug: false
        });
    }
    //删除上传图片
    function deleteUpload(keyname){
        $("#"+keyname+'_divshow').find('img').attr('src','');
        $("#"+keyname+'_divshow').hide();
        $("#"+keyname+'_divhide').show();
        $("#"+keyname+'_input').val('');
    }
</script>